import React from 'react'
import { Button, Modal } from 'antd'
import uiStyle from './index.less'
import { Divider, List, Typography } from 'antd'

const data = [
  'Racing car sprays burning fuel into crowd.',
  'Japanese princess to wed commoner.',
  'Australian walks 100km after outback crash.',
  'Man charged over missing wedding girl.',
  'Los Angeles battles huge wildfires.',
]

class FriendRequestModal extends React.PureComponent {
  constructor (props) {
    super(props)

  }

  render () {
    const { visible, onCancel, data, refuseRequest, agreeRequest } = this.props

    return (
      <Modal
        title="好友申请"
        width="600px"
        open={visible}
        maskClosable={false}
        onCancel={onCancel}
        footer={false}
      >
        <List
          style={{ height: '452px' }}
          bordered={true}
          dataSource={data}
          renderItem={(item) => (
            <List.Item>
              <Typography.Text mark>{item.msg}</Typography.Text>
              <Button onClick={() => agreeRequest(item)}>同意</Button>
              <Button onClick={() => refuseRequest(item)}>拒绝</Button>
            </List.Item>
          )}
        />
      </Modal>
    )
  }
}

export default FriendRequestModal